package com.feizhaiyou.test.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 接口返回类
 *
 * @author Jason
 *
 */
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class Result<T> {

    /**
     * 返回码
     */
    private Integer code;
    /**
     * 返回信息
     */
    private String message;
    /**
     * 返回数据
     */
    private T data;

    public static <T> Result<T> OK(T data) {
        return new Result<>(200, "success", data);
    }


}
